package com.zgl.gemduel.constants;

import com.zgl.gemduel.model.card;
import com.zgl.gemduel.model.gem;
import com.zgl.gemduel.model.GemColor;
import com.zgl.gemduel.model.Reward;
import com.zgl.gemduel.model.RewardType;

import java.util.List;

public class staticSource {

    // 宝石列表常量
    public static final List<gem> gemStaticSource = List.of(
        createGem("1", GemColor.red),
        createGem("2", GemColor.red),
        createGem("3", GemColor.red),
        createGem("4", GemColor.red),
        createGem("5", GemColor.blue),
        createGem("6", GemColor.blue),
        createGem("7", GemColor.blue),
        createGem("8", GemColor.blue),
        createGem("9", GemColor.green),
        createGem("10", GemColor.green),
        createGem("11", GemColor.green),
        createGem("12", GemColor.green),
        createGem("13", GemColor.gold),
        createGem("14", GemColor.gold),
        createGem("15", GemColor.gold),
        createGem("16", GemColor.black),
        createGem("17", GemColor.black),
        createGem("18", GemColor.black),
        createGem("19", GemColor.black),
        createGem("20", GemColor.white),
        createGem("21", GemColor.white),
        createGem("22", GemColor.white),
        createGem("23", GemColor.white),
        createGem("24", GemColor.pink),
        createGem("25", GemColor.pink)
    );

    // 卡片列表常量
    public static final List<card> cardStaticSource = List.of(
        createCard("1", 3, 1, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 0,
            new Reward(RewardType.TAKE_GEM, "获得一个宝石") , false , true , true),
        createCard("2", 3, 1, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 0,
            new Reward(RewardType.EXTRA_TURN, "额外回合") , false ,  true, true),
        createCard("3", 3, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
            new Reward(RewardType.CHANGE_COLOR, "变色") , false , true, true),
        createCard("4", 2, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("5", 2, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("6", 2, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("7", 2, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("8", 1, 2, 1, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("9", 1, 2, 1, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("10", 1, 2, 1, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("11", 1, 2, 1, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("12", 1, 2, 1, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , true, true),
        createCard("13", 4, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , false, true),
        createCard("14", 4, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , false, true),
        createCard("15", 4, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , false, true),
        createCard("16", 4, 2, 0, 0, 0, 0, 0 ,1, 1, 0, 0, 0, 0, 0,
                null , false , false, true)
    );

    // 创建宝石的辅助方法
    private static gem createGem(String id, GemColor color) {
        gem gem = new gem();
        gem.setId(id);
        gem.setColor(color);
        return gem;
    }
    
    // 创建卡片的辅助方法
    private static card createCard(String id, int level, int score,
            int discountRed ,  int discountWhite, int discountBlack,
            int discountBlue , int discountGreen,
            int costRed, int costBlue, int costGreen, int costPink, 
            int costBlack, int costWhite, int crownsNum, 
            Reward extraReward , boolean show , boolean buyable , boolean keepable ) {
        card card = new card();
        card.setId(id);
        card.setLevel(level);
        card.setScore(score);
        card.setDiscountRed(discountRed);
        card.setDiscountBlue(discountBlue);
        card.setDiscountBlack(discountBlack);
        card.setDiscountGreen(discountGreen);
        card.setDiscountWhite(discountWhite);
        card.setCostRed(costRed);
        card.setCostBlue(costBlue);
        card.setCostGreen(costGreen);
        card.setCostPink(costPink);
        card.setCostBlack(costBlack);
        card.setCostWhite(costWhite);
        card.setCrownsNum(crownsNum);
        card.setExtraReward(extraReward);
        card.setShow(show);
        card.setBuyable(buyable);
        card.setKeepable(keepable);
        return card;
    }
}